<%@ page language="java" contentType="text/html; charset=utf-8"
	pageEncoding="utf-8"%>
<%@page import="Dao.*"%>
<%@page import="Entity.*"%>
<%@page import="java.util.List"%>
<%@page import="java.util.ArrayList"%>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>搜索结果</title>
</head>
<body>
	<link href="css/showAllLearningResource.css" rel="stylesheet"
		type="text/css" />
	<jsp:useBean id="LearningResourceDao" class="Dao.LearningResourceDao"></jsp:useBean>
	<div class="header">
		<font size="6" color="#000000">学习资源搜索结果</font>
	</div>
	<div class="body">
		<table class="dataintable">
			<tr>
				<td>资源ID</td>
				<td>标签</td>
				<td>资源名称</td>
				<td>上传者ID</td>
				<td>上传时间</td>
				<td colspan="2">热度</td>
			</tr>
			<%
				String label = request.getParameter("searchText");
				List<LearningResource> search_result_lrlist = new LearningResourceDao().queryLearningResourceByLabel(label);
				for (LearningResource lr : search_result_lrlist) {
			%>
			<tr>
				<td><input type="text" value=<%=lr.getResourceID()%> readonly></td>
				<td><input type="text" value=<%=lr.getLabel()%> readonly></td>
				<td><input type="text" value=<%=lr.getResourceName()%>
					readonly></td>
				<td><input type="text" value=<%=lr.getUploaderID()%> readonly></td>
				<td><input type="text" value=<%=lr.getUploadTime()%> readonly></td>
				<td><input type="text" value=<%=lr.getThumbNumber()%> readonly>
					<a
					href="/UniversityResourceSystem/ThumbServlet?resourceID=<%=lr.getResourceID()%>&&userName=<%=session.getAttribute("session_userName")%>"
					style="text-decoration: none;">点赞</a></td>
				<td><a
					href="downloadLearningResource.jsp?resourceID=<%=lr.getResourceID()%>"
					style="text-decoration: none;" target="_blank">查看</a></td>
			</tr>
			<%
				}
			%>
		</table>
	</div>
	<div class="foot">
		<font color="white">Made by Aaron</a></font>
	</div>
</body>
</html>